<!DOCTYPE html>

<!--

uexEasemob是基于环信API封装的AppCan平台的插件模块。
详情可见：http://plugin.appcan.cn/details.html?id=406_index 内含插件包、插件源码及API文档



本插件为单例插件 ——
* 在任何网页调用本插件，调用的是同一个插件实例;
* 所有的API都是异步方法，不会直接返回值;
* 所有的回调都会传到root页面（config.xml中配置的App起始页面，本Demo中就为本页面）

以上内容非常重要，
以上内容非常重要，所以说了两遍。


root页面收到回调后，可以通过uexWindow的相关方法传递到各个网页去，
以下方法是您可能要用到的——
 传递给某个窗口:
    * uexWindow.evaluateScript;
    * uexWindow.evaluatePopoverScript
    * uexWindow.evaluateMultiPopoverScript
 传递给某些窗口:
    * uexWindow.publishChannelNotification
    * uexWindow.subscribeChannelNotification
 
 这些方法具体用法在文档 http://newdocx.appcan.cn/index.html?templateId=409 内有描述
 当然，也可参考本Demo内的调用。

 
 
 
有任何问题/发现bug等等等请去论坛 http://bbs.appcan.cn/forum.php?mod=forumdisplay&fid=61&page=1 发帖获得支持和反馈

3Q~

2015-6-16 by Cerino
 
 
 
-->
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
    <head>
        <title></title>
        <meta charset="utf-8">
        <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <link rel="stylesheet" href="css/ui-btn.css">
        <link rel="stylesheet" href="css/ui-base.css">
        <link rel="stylesheet" href="css/ui-box.css">
        <link rel="stylesheet" href="css/ui-color.css">
        <link rel="stylesheet" href="css/ui-res.css">

        <script src="js/zy_click.js">
        </script>
        <script src="js/zy_control.js"></script>
        <script>
        </script>
    </head>
    <body class="um-vp" ontouchstart>
        <div id="page_0" class="up ub ub-ver" tabindex="0">
            <!--header开始-->
            <div id="header" class="uh t-wh ub" style="background: #27A73F;">
               <!-- <div class="umw4 ub ub-ac ub-pc" ontouchstart="zy_touch()" onclick="uexWindow.close(-1)">
                    <div ontouchstart="zy_touch('btn-act')" class="btn uba b-bla uinn5 c-blu c-m1 uc-a t-wh" style="background: -webkit-gradient(linear,0 0,0 100%,from(#FFCD00),color-stop(50%,#FFBC00),color-stop(50%,orange));border: 1px solid #FFA700;-webkit-border-radius: 8px;  text-align: center;color: #712000;  display: block; font-size: 1em; padding: 0.2em;">返回</div>
                </div>
                -->
                <h1 class="ut ub-f1 ulev0 ut-s tx-c" tabindex="0">uexEasemob Demo</h1>
                <div class="umw4" ontouchstart="zy_touch()" onclick="">
                <!--插入按钮控件-->
                </div>
            </div>
            <!--header结束--><!--content开始-->
            <div id="content" class="ub-f1 tx-l t-bla" style="">
                
            </div>
        </div>
    </body>
    
    
    <script>
        

        
        

        zy_init();
        
window.uexOnload = function(type)
{
            
if (!type) {
    zy_con("content", "index_content.html", 0, $$("header").offsetHeight);
}
window.onorientationchange=window.onresize=function()
{
    zy_resize("content",0,$$("header").offsetHeight);
}
cp('root');

       


            
            
            
//***TEST***
uexEasemob.cbInit= function(data){
    postToFront('cbInit:',data);
}
 
 //[1.10]
 uexEasemob.onConnected= function(data){
     postToFront('onConnected:',data);
 }
 
 //[1.11]
 uexEasemob.onDisconnected= function(data){
     postToFront('onDisconnected:',data);
 }
 
 //[1.3]
 uexEasemob.cbLogin= function(data){
     postToFront('cbLogin:',data);
 }
 
 //[1.6]
 uexEasemob.cbRegisterUser= function(data){
     postToFront('cbRegisterUser:',data);
 }
 
 //[1.9]
 uexEasemob.cbGetLoginInfo= function(data){
     postToFront('cbGetLoginInfo:',data);
 }
 
 //[2.1]
 uexEasemob.onNewMessage= function(data){
     postToFront('onNewMessage:',data);
     globalPost('onNewMessage:'+data);
 }
 
 //[2.2]
 uexEasemob.onCmdMessageReceive= function(data){
     postToFront('onCmdMessageReceive:',data);
 }
 
 //[2.3]
 uexEasemob.onAckMessage= function(data){
     postToFront('onAckMessage:',data);
 }
 
 //[2.4]
 uexEasemob.onDeliveryMessage= function(data){
     postToFront('onDeliveryMessage:',data);
 }
 
 //[2.13]
 uexEasemob.cbGetMessageById= function(data){
     postToFront('cbGetMessageById:',data);
 }
 
 //[3.2]
 uexEasemob.cbGetConversationByName= function(data){
     postToFront('cbGetConversationByName:',data);
 };
 
 //[3.4]
 uexEasemob.cbGetMessageHistory= function(data){
     postToFront('cbGetMessageHistory:',data);
 };
 
 //[3.6]
 uexEasemob.cbGetUnreadMsgCount= function(data){
     alert(data);
     postToFront('cbGetUnreadMsgCount:',data);
 };
 
 //[3.10]
 uexEasemob.cbGetMsgCount= function(data){
     postToFront('cbGetMsgCount:',data);
 };
 
 //[3.16]
 uexEasemob.cbGetChatterInfo= function(data){
     postToFront('cbGetChatterInfo:',data);
 };
 
 //[3.18]
 uexEasemob.cbGetTotalUnreadMsgCount= function(data){
     postToFront('cbGetTotalUnreadMsgCount:',data);
 };

 
 //[4.1]
 uexEasemob.onContactAdded= function(data){
     postToFront('onContactAdded:',data);
 };
 
 //[4.2]
 uexEasemob.onContactDeleted= function(data){
     postToFront('onContactDeleted:',data);
 };
 
 //[4.3]
 uexEasemob.onContactInvited= function(data){
     postToFront('onContactInvited:',data);
 };
 
 //[4.4]
 uexEasemob.onContactAgreed= function(data){
     postToFront('onContactAgreed:',data);
 };
 
 //[4.5]
 uexEasemob.onContactRefused= function(data){
     postToFront('onContactRefused:',data);
 };
 
 //[4.7]
 uexEasemob.cbGetContactUserNames	= function(data){
     postToFront('cbGetContactUserNames	:',data);
 };
 
 //[4.13]
 uexEasemob.cbGetBlackListUsernames= function(data){
     postToFront('cbGetBlackListUsernames:',data);
 };
 
 //[5.1]
 uexEasemob.onInvitationDeclined= function(data){
     postToFront('onInvitationDeclined:',data);
 };
 
 //[5.2]
 uexEasemob.onUserRemoved= function(data){
     postToFront('onUserRemoved:',data);
 };
 
 //[5.3]
 uexEasemob.onGroupDestroy= function(data){
     postToFront('onGroupDestroy:',data);
 };
 
 //[5.4]
 uexEasemob.onApplicationReceived= function(data){
     postToFront('onApplicationReceived:',data);
 };
 
 //[5.5]
 uexEasemob.onApplicationAccept= function(data){
     postToFront('onApplicationAccept:',data);
 };
 
 //[5.6]
 uexEasemob.onApplicationDeclined= function(data){
     postToFront('onApplicationDeclined:',data);
 };
 
 //[5.28]
 uexEasemob.onGroupUpdateInfo= function(data){
     postToFront('onGroupUpdateInfo:',data);
 };
 
 //[5.15]
 uexEasemob.cbGetGroupsFromServer= function(data){
     postToFront('cbGetGroupsFromServer:',data);
 };
 
 //[5.17]
 uexEasemob.cbGetAllPublicGroupsFromServer= function(data){
     postToFront('cbGetAllPublicGroupsFromServer:',data);
 };
 
 //[5.19]
 uexEasemob.cbGetGroup= function(data){
     postToFront('cbGetGroup:',data);
 };
 
 //[5.27]
 uexEasemob.cbGetBlockedUsers= function(data){
     postToFront('cbGetBlockedUsers:',data);
 };
 
 //[6.1]
 uexEasemob.onCallReceive= function(data){
     postToFront('onCallReceive:',data);
 };
 
 //[6.2]
 uexEasemob.onCallStateChanged= function(data){
     postToFront('onCallStateChanged:',data);
 };
 
 //APNS
 uexEasemob.cbRegisterRemoteNotification= function(data){
     postToFront('cbRegisterRemoteNotification:',data);
 };
 

 uexEasemob.cbUpdatePushOptions= function(data){
     postToFront('cbUpdatePushOptions:',data);
 };
 

 uexEasemob.cbIgnoreGroupPushNotification= function(data){
     postToFront('cbIgnoreGroupPushNotification:',data);
 };
 
 uexEasemob.onApnsLaunch=function(data){
     postToFront('onApnsLaunch:',data);
 }
 uexEasemob.cbGetRecentChatters=function(data){
     postToFront('cbGetRecentChatters:',data);
 }
 uexEasemob.onMessageSent=function(data){
     postToFront('onMessageSent:',data);
 }
 uexEasemob.onGroupCreated=function(data){
     postToFront('onGroupCreated:',data);
 }

            
        }
    var cPage="1";
    cp=function(name){
        cPage=name;
    }
    
    
    

    postToFront=function(name,data){
        window.localStorage.fName=name;
        window.localStorage.fData=data;
        var jsStr='callBack();';
        if(cPage == 'root'){
            uexWindow.evaluatePopoverScript("root","content",jsStr);
        }else{
            uexWindow.evaluateScript(cPage,0,jsStr);
        }
        
    }
    globalPost=function(data){
        window.localStorage.gData=data;
        uexWindow.publishChannelNotification("1","");
    }
    </script>
</html>
